from packages.common.base_model import db, BaseModel


class Dept(BaseModel):
    """
    部门模型
    """
    __tablename__ = "sys_dept"
    __table_args__ = ({"comment": "部门", "extend_existing": True})
    parentId = db.Column(db.BigInteger, name="parent_id", unique=False, nullable=True, comment="父ID")
    pids = db.Column(db.String, name="pids", unique=False, nullable=True, comment="父ID集合")
    name = db.Column(db.String, name="name", unique=False, nullable=True, comment="部门名称")
    code = db.Column(db.String, name="code", unique=False, nullable=True, comment="唯一编码")
    sort = db.Column(db.BigInteger, name="sort", unique=False, nullable=True, comment="排序")
    enabled = db.Column(db.Integer, name="enabled", unique=False, nullable=True, comment="是否启用")
    leaderIds = db.Column(db.String, name="leader_ids", unique=False, nullable=True, comment="部门负责人ID集合")
    mainLeaderId = db.Column(db.BigInteger, name="main_leader_id", unique=False, nullable=True, comment="分管领导ID")
    remark = db.Column(db.String, name="remark", unique=False, nullable=True, comment="备注")
